import {connect} from "react-redux";
import OrderList from "../components/OrderList/OrderList";
import {getOrderList} from "../actions/orderListAction";
import {getReserveOrder} from "../apis/reserveOrderApi";

const mapStateToProps = (state) => ({
    orderList: state.orderList
});
const mapDispatchToProps = (dispacth) => ({
    getOrderList: async (email) => {
        const data = await getReserveOrder(email);
        return dispacth(getOrderList(data));
    }
});
const OrderListContainer = connect(mapStateToProps, mapDispatchToProps)(OrderList);

export default OrderListContainer;